package com.ruibang.glass.produce.service.impl;

import com.ruibang.glass.frequencycontrol.util.RedisUtils;
import com.ruibang.glass.produce.domain.req.UserPersonalizedStyleReq;
import com.ruibang.glass.produce.service.UserPersonalizedStyleService;
//import com.teaming.cloud.framework2.autoconfigure.redis.RedisSingleService;
import com.teaming.cloud.framework2.autoconfigure.redis.RedisSingleService;
import com.teaming.cloud.framework2.common.model.ResultBody;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Author: songJinKang
 * @CreateTime: 2024-01-31  20:16
 * @Description: TODO
 * @Version: 1.0
 */

@Slf4j
@Service
public class UserPersonalizedStyleServiceImpl implements UserPersonalizedStyleService {

//    @Autowired
//    private RedisSingleService redisService;

    @Autowired
    private RedisSingleService redisService;

    @Override
    public ResultBody get(String key) {
        return ResultBody.success(redisService.get(key));
    }

    @Override
    public ResultBody set(UserPersonalizedStyleReq userPersonalizedStyleReq) {
        redisService.set(userPersonalizedStyleReq.getKey(), userPersonalizedStyleReq.getValue());
        return ResultBody.success();
    }
}
